package vn.ivs.taxiapp.fragments;

import vn.ivs.taxiapp.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class S002Fragment extends Fragment implements OnClickListener {

	private ImageView imgHeaderBookmark;
	private TextView tvHeaderTitle;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		String arrCompany[] = { "Vinasun", "Mai Linh", "Taxi " };
		String arrCar[] = { "4Slot", "7Slot", "Xe om" };

		imgHeaderBookmark = (ImageView) getActivity().findViewById(
				R.id.imgHeaderBookmark);
		tvHeaderTitle = (TextView) getActivity().findViewById(
				R.id.tvHeaderTitle);
		tvHeaderTitle.setText("S002 Title");
		View view = inflater.inflate(R.layout.fragment_s002, container, false);

		Spinner spinCompany = (Spinner) view.findViewById(R.id.snCompany);
		Spinner spinCarType = (Spinner) view.findViewById(R.id.snCarType);

		ArrayAdapter<String> adapterCompany = new ArrayAdapter<String>(
				this.getActivity(), android.R.layout.simple_spinner_item,
				arrCompany);
		adapterCompany
				.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
		spinCompany.setAdapter(adapterCompany);

		ArrayAdapter<String> adapterCarType = new ArrayAdapter<String>(
				this.getActivity(), android.R.layout.simple_spinner_item,
				arrCar);
		adapterCarType
				.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
		spinCarType.setAdapter(adapterCarType);

		imgHeaderBookmark.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Toast.makeText(getActivity(), "BOOKMARK S002",
						Toast.LENGTH_LONG).show();
			}
		});
		return view;
	}

	@Override
	public void onClick(View v) {

	}

}
